<%@page import="br.com.colegio.util.UtilData"%>
<%@page import="br.com.colegio.dao.storage.BoletoData"%>
<jsp:include page="top.jsp"></jsp:include>

</head>
<body>

<jsp:include page="menu.jsp"></jsp:include>

<%
String boletos_csv = request.getParameter("boletos_csv");

if (boletos_csv != null && !boletos_csv.equals(""))
{
	for (String s : boletos_csv.split("\n"))
	{
		if (!s.trim().equals(""))
		{
			String[] c = s.split(";");

			out.print(c[0] + " - " + 
				BoletoData.getInstance().registrarPagamento(c[0],
					UtilData.parser(c[1], "dd/MM/yy"),
					c[2],
					Integer.parseInt(c[6].trim()),
					Double.parseDouble(c[3]),
					Double.parseDouble(c[4]),
					Double.parseDouble(c[5])) + "</br>");
		}
	}
}
%>
<form name=formListar method="post">
<table border=0 cellpadding=3 cellspacing=1 width=900 align=center>
	<tr>
		<td><textarea name=boletos_csv rows="20" cols="100"></textarea></td>
	</tr>
	<tr>
		<td><input type=submit value="gravar"></td>
	</tr>
</table>
</form>
</body>
</html>